package com.w3cjava.common.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @Author cos
 * @description 通过引入外部properties自定义配置
 */
@Configuration
// 指定配置文件前缀
@ConfigurationProperties(prefix="w3cjava")
// 指明使用的配置文件
@PropertySource("classpath:w3cjava.properties")
// @Component
public class W3cjavaConfigBean {
    private String name;
    private Integer age;

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getAge() {
        return age;
    }
    public void setAge(Integer age) {
        this.age = age;
    }

}
